package cn.gson.springboot.model.mapper.aftermapper;

import cn.gson.springboot.model.pjos.*;
import cn.gson.springboot.model.pjos.Process;
import cn.gson.springboot.model.vo.aftervo.MainProductVo;
import cn.gson.springboot.model.vo.aftervo.MaintainChartVo;
import cn.gson.springboot.model.vo.aftervo.PieDoubleVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface MaintainMapper {

    //分页查询维修工单
    public List<Maintain> tainPage(@Param("stateId") Integer stateId,
                                   @Param("tainOrder") String search);

    //查询所有客户
    public List<Customer> custAll();

    //查询当天最大的单号
    public String selectMaxName();

    //查询维修部门
    public List<Dept> deptName();

    //根据客户查出联系人
    public List<Culinkman> linkName(@Param("customId") Integer person);

    //回显维修主表
    public Maintain tainAll(@Param("tainId") Integer tainIds);

    //回显维修详表
    public MaintainDetail mainAll(@Param("tainId") Integer tainIds);

    //查询维修进度
    public List<Schedule> duleAll();

    //按维修主表id查询出维修详表id
    public Integer selectTainsId(Integer tainId);

    //回显检测表
    public Process prosAll(@Param("tainId") Integer tainIds);

    //回显客户沟通表
    public Interflow flowAll(@Param("tainId") Integer tainIds);

    //回显维修过程表
    public Course courAll(@Param("tainId") Integer tainIds);

    //通过维修主表id找出维修进度
    public Integer checkByStateId(@Param("tainId") Integer tainIds);

    //通过维修主表id找出维修过程表id
    public Integer checkByCourId(Integer tainId);

    //通过维修主表id找出客户沟通表id
    public Integer checkByFlowId(Integer tainId);

    //保修状况月度工单数分布
    public List<MaintainChartVo> repairByMonth();

    //维修产品月度工单费用分布
    public List<PieDoubleVo> moneyByMonth();

    //维修完成月度工单数分布
    public List<Integer> deliveredById();

    //维修完成月度工单数分布的月份
    public List<String> deliveredByMonth();

    //维修未完成月度工单数分布
    public List<Integer> undeliveredByState();

    //维修未完成月度工单数分布的月份
    public List<String> undeliveredByMonth();

    //工单月度分布
    public List<Integer> orderByCount();

    //工单月度分布的月份
    public List<String> orderByMonth();

    //维修进度漏斗
    public List<MaintainChartVo> funnelByState();

    //维修总控台待检测
    public List<Maintain> tainByTwo();

    //维修总控台待确认
    public List<Maintain> tainByThree();

    //维修总控台待维修
    public List<Maintain> tainByFour();

    //维修总控台维修中
    public List<Maintain> tainByFive();

    //维修总控台待沟通
    public List<Maintain> tainBySix();

    //维修总控台维修完成
    public List<Maintain> tainBySeven();

    //维修总控台未收尽款
    public List<Maintain> tainByEight();

    //通过维修单号查出维修主表id
    public Integer orderByTainId(String tainOrder);

    //根据退换货类型查出换货单号
    public List<Map<String,Object>> changeByOrder();

    //根据退换货类型查出退货单号
    public List<Map<String,Object>> returnByOrder();

    //换货单产品信息
    public List<MainProductVo> productById(Integer excId);

    //退货单产品信息
    public List<MainProductVo> productByReturn(Integer retuId);

    //根据换货单号查出换货id
    public Integer exchangeById(String ecName);

    //根据退货单号查出退货id
    public Integer returnById(String retuName);

    //根据换货单查询客户
    public List<Customer> customerByChange(String ecName);

    //根据退货单查询客户
    public List<Customer> customerByReturn(String retuName);

    //查询维修部员工
    public List<Emp> repairByEmp();
}
